package com.ds.infrastructure.hyperspace.console.dao.dao;

import com.ds.infrastructure.hyperspace.console.dao.mapper.TbNodeMetricsAggregationMapper;
import com.ds.infrastructure.hyperspace.console.entity.page.TbPageWhere;
import com.ds.infrastructure.hyperspace.console.entity.table.TbNodeMetricsAggregation;
import com.ds.infrastructure.hyperspace.console.entity.table.TbResultMap;
import com.ds.infrastructure.hyperspace.console.entity.where.TbCustomWhere;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author: yaozhendong
 * @create: 2019-11-01 15:34
 **/

@Repository
public class TbNodeMetricsAggregationDao {
    @Autowired
    TbNodeMetricsAggregationMapper tbNodeMetricsAggregationMapper;

    public TbNodeMetricsAggregation selectByPrimaryKey(Long id) {
        return tbNodeMetricsAggregationMapper.selectByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(TbNodeMetricsAggregation record) {
        return tbNodeMetricsAggregationMapper.updateByPrimaryKeySelective(record);
    }

    public int insertSelective(TbNodeMetricsAggregation record) {
        return tbNodeMetricsAggregationMapper.insertSelective(record);
    }

    public List<TbNodeMetricsAggregation> selectListForPage(TbNodeMetricsAggregation where, TbCustomWhere mapWhere, TbPageWhere pageWhere) {
        return tbNodeMetricsAggregationMapper.selectListForPage(where, mapWhere, pageWhere);
    }

    public int selectListForPageCount(TbNodeMetricsAggregation where, TbCustomWhere mapWhere) {
        return tbNodeMetricsAggregationMapper.selectListForPageCount(where, mapWhere);
    }

    public int insertList(List<TbNodeMetricsAggregation> recordList) {
        if (recordList == null || recordList.isEmpty()) {
            return 0;
        }
        return tbNodeMetricsAggregationMapper.insertList(recordList);
    }

    public List<TbResultMap> sumRequestSecondsCount(TbCustomWhere mapWhere) {
        return tbNodeMetricsAggregationMapper.sumRequestSecondsCount(mapWhere);
    }

    public int delete(TbCustomWhere mapWhere) {
        return tbNodeMetricsAggregationMapper.delete(mapWhere);
    }
}
